package com.lzy.system.organization.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lzy.exception.BusException;
import com.lzy.system.organization.dto.SysUserDTO;
import com.lzy.system.organization.entity.SysUser;
import com.lzy.system.organization.entity.security.entity.SecurityUser;
import com.lzy.system.organization.vo.SysUserVo;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lcc
 * @since 2022-08-13
 */
public interface ISysUserService extends IService<SysUser> {

    public void exitLogin(SecurityUser securityUser) throws BusException;

    /**
     * 根据用户名获取用户信息
     * @param userId
     * @return
     * @throws Exception
     */
    public SysUserVo getUserByUserId(String userId) throws BusException;

    /**
     * 根据id获取用户信息
     * @param id
     * @return
     * @throws BusException
     */
    public SysUserVo getUserById(Long id) throws BusException;

    /**
     * 新增用户
     * @param sysUserDTOs
     * @throws Exception
     */
    public void add(List<SysUserDTO> sysUserDTOs) throws BusException;

    /**
     * 修改用户信息
     * @param sysUserDTOs
     * @return
     * @throws Exception
     */
    public boolean update(List<SysUserDTO> sysUserDTOs) throws BusException;

    /**
     * 删除用户
     * @param ids
     * @return
     * @throws Exception
     */
    public boolean del(String ids) throws BusException;

    /**
     * 根据用户名或者昵称查询用户列表
     * @param username
     * @param nickname
     * @return
     * @throws Exception
     */
    public IPage<SysUserVo> getList(String username,String nickname,int limit,int page) throws BusException;

    /**
     * 修改密码
     * @param pwd_old
     * @param pwd_new
     * @param pwd_confirm
     * @throws Exception
     */
    public void updatePwd(String pwd_old,String pwd_new,String pwd_confirm) throws BusException;
}
